<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    {% load static %}
    <title>influx</title>
    <link rel="stylesheet" href="{% static 'plugins/bootstrap-3.4.1-dist/css/bootstrap.css' %}">
    <script src="{% static 'js/jquery-3.7.0.min.js' %}"></script>
    <script src="{% static 'plugins/bootstrap-3.4.1-dist/js/bootstrap.min.js' %}"></script>
    <script src="/static/js/get_all_list.js"></script>
    <style type="text/css">
        .line1{
            left:100px;
            width:850PX;
            height:5px;
            border:none;
            border-top:1px solid #e7ebe7;
        }
        .form-inline .form-control {
             display: inline-block;
             width: 300px;
             vertical-align: middle;
        }
        .warning{
             left: 560px;
             position:absolute;
        }
        .warning2{
             left: 1000px;
             position:absolute;
        }
        .modal-dialog {
             width: 900px;
             margin: 30px auto;
        }
        .navbar{
            border-radius: 0;
        }



    </style>
</head>
<body>
{% include 'head.html' %}
<div>
    <div class="container">
        <!--        <div>-->
        <!--            <h1 class="control-label">造数1表单</h1>-->
        <!--        </div>-->
        <form class="form-horizontal" role="form" method="post" action="/modsim/" onsubmit="return check(this)">
            {% csrf_token %}
            <div class="panel panel-info">
                <div class="panel-heading">
                    <h3 class="panel-title">基本信息</h3>
                </div>
                <div class="panel-body">
                    <div class="form-inline">
                        <label class="col-md-2 control-label ">Modsim IP</label>
                        <input type="text" class="form-control" id="ModsimIP"
                               placeholder="请输入Modsim IP" name="ModsimIP" value="{{data.ModsimIP}}">
                        <span style="color:red; display:none" id="inputIP">Modsim IP</span>
                    </div>
                    <div class="form-inline" style="margin-top:10px">
                        <label class="col-md-2 control-label">Port</label>
                        <input class="col-md-1 form-control" id="ModsimPort" type="text" placeholder="ModsimPort"
                               name="ModsimPort" value="{{ data.ModsimPort }}">
                    </div>
                </div>
            </div>

            <div class="panel panel-info">
                <div class="panel-heading">
                    <h3 class="panel-title">数据设置</h3>
                </div>
                <div class="panel-body">
                    <div class="form-inline">
                        <label class="col-md-2 control-label">地址</label>
                        <input class="col-md-2 form-control" id="ModsimAddress" type="text" placeholder="基础数"
                               name="ModsimAddress" value="{{ data.ModsimAddress }}">
                        <label class="col-md-2 control-label ">数据类型</label>
                        <select class="form-control" id="ModsimType"
                                name="ModsimType" value="{{ data.ModsimType }}">
                            <option value="FLOAT32">FLOAT32</option>
                            <option value="UINT8">UINT8</option>
                            <option value="UINT16">UINT16</option>
                            <option value="UINT32">UINT32</option>
                        </select>
                    </div>
                    <div class="form-inline" style="margin-top:10px">
                        <label class="col-md-2 control-label">数值</label>
                        <input class="col-md-2 form-control" id="ModsimNumber" type="text" placeholder="改为目标数值"
                               name="ModsimNumber" value="{{ data.ModsimNumber }}">
                    </div>
                    <div class=" col-md-1 col-md-offset-1 control-label">
                        <button type="submit" class="btn btn-primary " name="Submit" value="">改值</button>
                    </div>

                </div>
            </div>

        </form>
    </div>
</div>
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    查询结果
                </h4>
            </div>
            <div class="modal-body">
                {% for line in lines %}
                    <p>{{line}}</p>
                    {% endfor %}
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>

            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

</body>
<script>
    var type = "{{ data.ModsimType }}"
    console.log(type)
    $("#ModsimType ").val(type);
    $('li').attr('class','')
    $('#modsim').addClass('active')
</script>
</html>